package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import pojo.TbItem;
import service.TestService;

import javax.annotation.Resource;

@Controller
public class TestController {

    @Resource
    private TestService TestServiceImpl;

    /**
     * 测试项目配置,浏览器路径 http://localhost:8081/item/536563
     *
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/item/{id}")
    public TbItem getById(@PathVariable long id) {
        TbItem item = TestServiceImpl.getItemById_Test(id);
        return item;
    }

}
